package com.tanhua.app.controller;

import com.tanhua.app.service.PeachblossomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @Author 沈大哥
 * @Date 2022/3/7 17:15
 * @Version 1.0
 **/
@RestController
@RequestMapping("/peachblossom")
public class PeachblossomController {
    @Autowired
    private PeachblossomService peachblossomService;

    /**
     * 桃花传音 -发送语音
     * @param soundFile
     * @return
     */
    @PostMapping
    public ResponseEntity sendVoice(MultipartFile soundFile) throws IOException {
        peachblossomService.sendVoice(soundFile);
        return ResponseEntity.ok(null);
    }
}
